extends ./index.jade

block content
	.rightSide
		.container-fluid
			.row
				form.form.form-inline#tradeForm
					span.managerOnly
						label 选择学校
						select#schoolSelect
					label.marginLeft 选择日期
					input#tradeDate.datepicker.date.form_datetime.controls(type='text' placeholder='请选择时间' required)
					button.btn.btn-primary.marginLeft.tradeQuery 查询
			.row
				+alert('tradeAlert')
				table.table.table-bordered.table-hover#tradeTable
			.row.text-right.forcedVerticalCenter.paginatorRow
				span.marginLeft.marginRight
					|共
					span#total
					|条记录
				#paginator.paginator
					
	script(type='text/x-dot-template' id='schoolTmpl')
		{{~it:school}}
		option(value='{{=school.id}}') {{=school.name}}
		{{~}}
	script(type='text/x-dot-template' id='shopTmpl')
		{{~it:shop}}
		option(value='{{=shop.id}}') {{=shop.name}}
		{{~}}
	script(type='text/x-dot-template' id='tradeTmpl')
		thead
			th 收货人
			th 联系电话
			th 收货地址
			th 留言
			th 订单状态
			th 交易创建时间
		tbody
			|{{~it :trade:index}}
			tr
				td
					p {{=trade.receiver_name}}
				td
					p {{=trade.receiver_mobile}}
				td
					p {{=trade.receiver_address}}
				td 
					{{? trade.trade_comment===''}}
					|无
					{{??}}
					{{=trade.trade_comment}}
					{{?}}
				td {{=trade.status}}
				td {{=trade.created_time}}
			|{{~}}
	link(rel='stylesheet' href='/css/lib/bootstrap-datetimepicker.css')
	link(rel='stylesheet' href='/css/lib/select2.min.css')
	script(src='/js/lib/require.js' data-main='/js/trade_manage')